package com.tsinghua.discharge.dao;

import com.tsinghua.discharge.model.BaseData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface BaseDataMapper {
    int deleteByPrimaryKey(Integer baseId);

    int insert(BaseData record);

    int insertSelective(BaseData record);

    BaseData selectByPrimaryKey(Integer baseId);

    int updateByPrimaryKeySelective(BaseData record);

    int updateByPrimaryKey(BaseData record);

    List<Float> selectbyCondition(@Param("baseRegionId") Integer baseRegionId,@Param("baseDateId") Integer baseDateId, @Param("baseSectorId")Integer baseSectorId,@Param("baseScenario") String baseScenario,@Param("baseFuel")String baseFuel);

    List<String> scenarioSelect(int userId);

    List<String> fuelSelect(int userId);

    Integer selectByBasedata(BaseData record);

    Float selectSum(BaseData record);

    List<Float> selectbyConditionBulk(@Param("baseRegionId") Integer baseRegionId,@Param("baseDateId") Integer baseDateId, @Param("SectorIds")List<Integer> SectorIds,@Param("baseScenario") String baseScenario,@Param("baseFuel")String baseFuel);

    Float sumByregion(@Param("baseDateId") Integer baseDateId, @Param("SectorIds")List<Integer> SectorIds,@Param("baseScenario") String baseScenario,@Param("baseFuel")String baseFuel,@Param("baseUserId")Integer baseUserId,@Param("baseRegionId")Integer baseRegionId);

    Float sumByregion2(@Param("baseDateId") Integer baseDateId, @Param("SectorId")Integer SectorId,@Param("baseScenario") String baseScenario,@Param("baseFuel")String baseFuel,@Param("baseUserId")Integer baseUserId,@Param("baseRegionId")Integer baseRegionId);
    BaseData selectByFiveIdsAndSce(@Param("scenario")  String baseScenario, @Param("dateId") Integer baseDateId,
                                   @Param("secId") Integer baseSectorId, @Param("areaId") Integer baseRegionId,
                                   @Param("polId") Integer basePollutantId, @Param("createUserId") Integer baseUserId);

    Integer deleteByUser(@Param("userId") Integer userId);
    List<Float> selectbyConditions(@Param("RegionId") Integer baseRegionId,@Param("baseDateId") Integer baseDateId,
                                   @Param("baseSectorId")Integer baseSectorId,@Param("baseScenario") String baseScenario,
                                   @Param("baseFuel")String baseFuel ,@Param("userId") Integer userId);

}